package xyz.xiaomeiqiu.study;

import xyz.xiaomeiqiu.study.activemq.QueueType;
import xyz.xiaomeiqiu.study.activemq.TopicType;

public class App {

    public static void main(String[] args) {
        thread(new QueueType.QueueProducer(), false);
        thread(new QueueType.QueueProducer(), false);
        thread(new QueueType.QueueConsumer(), false);


        thread(new TopicType.TopicProducer(), false);
        thread(new TopicType.TopicConsumer(), false);
        thread(new TopicType.TopicConsumer(), false);
    }

    public static void thread(Runnable runnable, boolean daemon) {
        Thread brokerThread = new Thread(runnable);
        brokerThread.setDaemon(daemon);
        brokerThread.start();
    }
}